Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix QuarkusProdModeTest mistaking Hibernate ORM logs for a proof of application startup #40652

Merged

Conversation

yrodiere
Copy link
Member

@yrodiere yrodiere commented May 15, 2024

Without this, QuarkusProdModeTest runs the tests too early because it mistakes the following log line for the "Installed features: ..." line that Quarkus usually outputs on startup:

2024-05-15 09:11:26,199 WARN [org.hib.dia.Dialect] (main) HHH000511: The -9999.-9999.-9999 version for [org.hibernate.dialect.PostgreSQLDialect] is no longer supported, hence certain features may not work properly. The minimum supported version is 12.0.0. Check the community dialects project for available legacy versions.

Note how the line contains the word "features".

See https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/Hibernate.206.2E5/near/438739167

…pplication startup

Without this, QuarkusProdModeTest runs the tests too early because it
mistakes this log line for the "Installed features: ..." line that
Quarkus usually outputs on startup:

> 2024-05-15 09:11:26,199 WARN [org.hib.dia.Dialect] (main) HHH000511: The -9999.-9999.-9999 version for [org.hibernate.dialect.PostgreSQLDialect] is no longer supported, hence certain features may not work properly. The minimum supported version is 12.0.0. Check the community dialects project for available legacy versions.

Note how the line contains the word "features".

See https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/Hibernate.206.2E5/near/438739167
@yrodiere yrodiere force-pushed the quarkusprodmodetest-start-condition branch from f009490 to 5ea9b52 Compare May 15, 2024 08:49
@yrodiere yrodiere requested a review from geoand May 15, 2024 08:49
@yrodiere
Copy link
Member Author

Thanks for the review, I addressed the comments and rebased on main.

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice, thanks a lot!

@yrodiere
Copy link
Member Author

yrodiere commented May 15, 2024

@gsmet @aloubyansky I'm marking for backports back to 3.2.

I think this would affect even very old apps, as long as they have a QuarkusProdModeTest and a log on startup including the word "features" -- which could be the result of using Hibernate ORM 6.2+ together with setting quarkus.datasource.db-version to something very old, or of other random logs.

The bug would have those tests fail randomly depending on how long the app takes to start. I'll let you judge of severity.

@yrodiere yrodiere added the triage/waiting-for-ci Ready to merge when CI successfully finishes label May 15, 2024
Copy link

quarkus-bot bot commented May 15, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 5ea9b52.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.


Flaky tests - Develocity

⚙️ JVM Tests - JDK 21

📦 extensions/smallrye-reactive-messaging-kafka/deployment

io.quarkus.smallrye.reactivemessaging.kafka.deployment.dev.KafkaDevServicesDevModeTestCase.sseStream - History

  • io.quarkus.builder.BuildException: Build failure: Build failed due to errors [error]: Build step io.quarkus.kafka.client.deployment.DevServicesKafkaProcessor#startKafkaDevService threw an exception: java.lang.RuntimeException: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image docker.io/vectorized/redpanda:v22.3.4 at io.quarkus.kafka.client.deployment.DevServicesKafkaProcessor.startKafkaDevService(DevServicesKafkaProcessor.java:105) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) - java.lang.RuntimeException
java.lang.RuntimeException: 
io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.kafka.client.deployment.DevServicesKafkaProcessor#startKafkaDevService threw an exception: java.lang.RuntimeException: org.testcontainers.containers.ContainerLaunchException: Container startup failed for image docker.io/vectorized/redpanda:v22.3.4
	at io.quarkus.kafka.client.deployment.DevServicesKafkaProcessor.startKafkaDevService(DevServicesKafkaProcessor.java:105)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:256)

@yrodiere yrodiere merged commit 1eed729 into quarkusio:main May 15, 2024
35 checks passed
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label May 15, 2024
@quarkus-bot quarkus-bot bot added this to the 3.12 - main milestone May 15, 2024
@gsmet gsmet modified the milestones: 3.12 - main, 3.10.2 May 21, 2024
@gsmet gsmet modified the milestones: 3.10.2, 3.8.5 May 22, 2024
@yrodiere yrodiere deleted the quarkusprodmodetest-start-condition branch June 21, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants